import { AstContext } from "../../../context";
import { Pages } from "../Pages";
import { PageVisitor } from "../pageVisitor";

export function parseLiveBottomBarLeftLayout(visitor: PageVisitor, ast: AutoJs.UiObject, ctx: AstContext) {
    if (ast.visibleToUser()) {
        ctx.set(`currentPage`, Pages.live)
    }
    const node = ctx.bfsOne(ast, it => ctx.getSid(it) === `live_bottom_bar_single_icon_container` && it.clickable())
    if (node) {
        ctx.set('toShare', () => {
            node.click()
            node.recycle()
        })
    }
    return true;
}